@import './variables.less';
@import './fontawesome/less/fontawesome.less';
@import './fontawesome/less/solid.less';
@import './fontawesome/less/brands.less';
@import './fontawesome/less/solid.less';

body {
  margin: 0;
  overflow: hidden;
  min-height: 500px;
  font-size: 13px;
  overflow-x: auto;
  background-color: #ebeef5;
  font-family: 'PingFangSC-Regular', 'PingFang SC';
}

.ant-card {
  margin-bottom: 5px !important;
  border-radius: 8px !important;
  border: 1px solid rgba(0, 0, 0, 0.125);
  box-shadow: 0px 2px 4px 0px rgba(216, 216, 216, 1);

  > .ant-card-head {
    color: #333;
    border: none !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.125) !important;
    padding: 0 10px !important;
    border-radius: 8px 8px 0 0 !important;

    > .ant-card-head-wrapper {
      font-weight: bold;

      > .ant-card-extra {
        > button,
        > .btn-group {
          position: relative;
          right: -2px;
          top: 0;
        }

        > .btn-group {
          top: -0.5px;
        }
      }
    }
  }

  .ant-card-body {
    padding: 5px 0 !important;

    .ant-row {
      padding-left: 10px;
      padding-right: 10px;
      display: flex;
      align-items: flex-start;

      &:last-of-type {
        margin-bottom: 0;
      }
    }

    > .ant-table-wrapper {
      margin: 0;
      padding: 0;
    }
  }

  &.ant-card-small {
    > .ant-card-body {
      padding-bottom: 5px;
      padding-top: 5px;
    }

    > .ant-card-head {
      min-height: 2rem;
      vertical-align: middle;

      > .ant-card-head-wrapper {
        > .ant-card-extra {
          padding: 0;
        }
      }
    }
  }

  &.default {
    border-color: #ccc;

    > .ant-card-head {
      border-color: #e8e8e8;
      background-color: #f5f5f5;
      background-image: linear-gradient(to bottom, #f5f5f5 0, #e8e8e8 100%);
    }
  }

  &.primary {
    border-color: #337ab7;

    > .ant-card-head {
      color: #fff;
      background-color: #337ab7;
      border-color: #337ab7;
      background-image: linear-gradient(to bottom, #337ab7 0, #2e6da4 100%);
    }
  }

  &.success {
    border-color: #d6e9c6;

    > .ant-card-head {
      color: #3c763d;
      background-color: #dff0d8;
      background-image: linear-gradient(to bottom, #dff0d8 0, #d0e9c6 100%);
    }
  }

  &.error {
    border-color: #ebccd1;

    > .ant-card-head {
      color: #a94442;
      background-color: #f2dede;
      border-color: #ebccd1;
      background-image: linear-gradient(to bottom, #f2dede 0, #ebcccc 100%);
    }
  }
}

.ant-tabs {
  > .ant-tabs-nav {
    > .ant-tabs-nav-wrap {
      > .ant-tabs-nav-list {
        > .ant-tabs-tab {
          margin-right: 6px;
          position: relative;

          & + .ant-tabs-tab {
            margin-left: 16px;

            &::before {
              content: ' ';
              display: inline-block;
              height: 15px;
              position: absolute;
              width: 0;
              top: 12px;
              left: -12px;
              padding-left: 0;
              border-left: 2px solid #ccc;
            }
          }
        }
      }
    }
  }
}

.layout {
  padding: 0;
  display: flex;
  flex-flow: row nowrap;
  width: 100%;

  > .main-content {
    position: relative;
    overflow: auto;
    display: inline-block;
    min-width: 600px;
    width: calc(100% - 180px);

    > .header-panel {
      width: 100%;
      line-height: 50px;
      background-color: #fff;
      display: flex;
      flex-flow: row nowrap;
      white-space: nowrap;
      box-shadow: 0px 2px 6px 0px rgba(204, 204, 204, 0.5);

      > .btn-toggle {
        display: none;
        width: 52px;
        flex: 0;
        position: relative;
        top: 3px;
        margin-left: 5px;
        color: #fff;
        padding-bottom: 0;

        > i {
          border-radius: 4px;
        }
      }

      > .logo {
        flex: 1;
        line-height: 48px;
        display: inline-block;
        vertical-align: middle;
        padding-left: 10px;

        > a {
          color: black;
          font-size: 18px;
          font-weight: 500;
          text-decoration: none;
          display: inline-block;
          text-transform: capitalize;
          vertical-align: middle;

          > img {
            width: 30px;
            height: 30px;
          }
        }

        > .agent-warning {
          font-size: 16px;
          color: #d0021b;
          display: inline-block;
          text-align: center;
          line-height: 18px;
          position: relative;
          top: 18px;
          left: -100px;
          font-style: normal;
          font-weight: bold;
        }
      }

      > .navbar-header {
        display: flex;
        height: 50px;
        line-height: 50px;
        vertical-align: middle;
        flex-flow: row nowrap;
        user-select: none;
        margin-right: 10px;

        &:before {
          display: inline;
          content: ' ';
        }

        .nav {
          &:before {
            display: inline;
            content: '';
          }

          > li {
            line-height: 46px;
          }

          .dropdown-menu {
            top: 103%;
            left: 0;
            min-width: 160px;
            right: 0px;
            margin: 2px -8px;

            &:before {
              content: '';
              position: absolute;
              width: 0;
              height: 0;
              left: 18px;
              top: -20px;
              border: 10px solid transparent;
              border-bottom-color: #ccc;
              text-align: center;
            }

            min-width: 100px;
          }
        }

        .nav {
          display: flex;
          flex-flow: row nowrap;
          align-items: center;

          .user-flag {
            border-radius: 50%;
            background: #1e91e8;
            color: white;
            height: 40px;
            width: 40px;
            line-height: 40px;
            margin-right: 10px;
            display: inline-block;
            text-align: center;
            vertical-align: middle;
          }

          .user-info {
            width: 75px;
            margin-right: 5px;
          }
        }
      }
    }

    > .content-panel {
      padding: 8px 6px 0 6px;

      > .breadcrumbs {
        display: flex;
        flex-flow: row nowrap;
        padding: 0 0 0 4px;
        font-size: 14px;

        > .breadcrumb {
          flex: 1;
          margin: 0;
          padding: 0;
          background-color: transparent;

          > li {
            cursor: default;
            color: rgba(0, 0, 0, 0.42);
            user-select: none;

            &:before {
              color: #000;
              padding: 0 2px;
            }

            &.active {
              color: rgba(0, 0, 0, 0.85);
              font-weight: bold;
              user-select: auto;
            }

            > a {
              color: #1e91e8;

              &:not([href]),
              &[href='#'],
              &[href=''] {
                cursor: default;
                color: rgba(0, 0, 0, 0.42);
                text-decoration: none;
              }
            }
          }
        }

        > .links {
          vertical-align: middle;

          > a,
          > * {
            font-weight: normal !important;
            display: inline-block;
            cursor: pointer !important;
            user-select: none !important;
          }
        }
      }

      > .content-body {
        width: 100%;
        overflow-x: hidden;
        background-color: transparent;
        margin: 0;
        margin-top: 8px;
        top: 0;
        position: relative;
        clear: both;

        > .ant-row,
        > .ant-form,
        > .ant-card,
        > .ant-tabs {
          clear: both;
          margin: 0;
          background: #fff;
          padding: 5px 15px;
          margin-bottom: 10px;
          border-radius: 5px;

          > .ant-row {
            align-items: center;

            .ant-form-item {
              margin-bottom: 0 !important;
            }

            &:not(:first-of-type) {
              margin-top: 10px;
            }
          }

          > .ant-card-body {
            padding-left: 0;
            padding-right: 0;

            .ant-table-wrapper {
              margin: 0;
              padding: 0;
            }
          }
        }

        > .ant-row {
          &:not(:first-of-type) {
            padding: 0;
            background: transparent;
          }

          &:last-of-type {
            margin-bottom: 0;
          }
        }

        .ant-tabs {
          line-height: 1;
          padding: 0 10px;
          background: #fff;

          > .ant-tabs-nav {
            line-height: 1;
            margin-bottom: 0;
          }

          .ant-tabs-tabpane {
            margin-top: 5px;
            overflow-y: auto;
            overflow-x: hidden;

            > .ant-table-wrapper {
              margin: 0;
              padding: 0;
            }
          }
        }

        > [class^='ant-'] {
          &:last-of-type {
            margin-bottom: 0;
          }
        }
      }
    }
  }
}

div,
ul,
form,
textarea,
span,
p,
pre {
  &::-webkit-scrollbar {
    width: 6px;
    height: 8px;
  }

  &::-webkit-scrollbar-track {
    border-radius: 0;
    background-color: transparent;
  }

  &::-webkit-scrollbar-thumb {
    border-radius: 8px;
    background-color: #1e91e8;
  }
}

body::-webkit-scrollbar {
  width: 6px;
  height: 8px;
}

body::-webkit-scrollbar-track {
  border-radius: 0;
  background-color: transparent;
}

body::-webkit-scrollbar-thumb {
  border-radius: 8px;
  background-color: rgba(0, 0, 0, 0.2);
}

.ant-modal {
  .ant-modal-close {
    .anticon {
      top: -5px;
      color: #fff;
      font-weight: bolder;
      position: relative;
      vertical-align: 0;
      box-shadow: inset 1px #eee;
    }
  }

  .ant-modal-header {
    color: #fff;
    background-color: #1890ff;
    padding: 10px 15px;

    > .ant-modal-title {
      color: #fff;
      font-weight: bolder;
    }
  }

  .ant-modal-body {
    padding: 10px 15px;
    overflow: auto;

    > .ant-table-wrapper {
      margin-top: 0;
    }
  }
}

.full-modal,
.compact-modal {
  .ant-modal {
    max-width: 100%;
    top: 0;
    padding-bottom: 0;
    margin: 0;
  }

  .ant-modal-content {
    display: flex;
    flex-direction: column;
    height: calc(100vh);
    overflow-y: auto;
  }

  .ant-modal-body {
    flex: 1;
    padding: 0;
  }
}

.compact-modal {
  .ant-modal-content {
    display: flex;
    flex-direction: column;
    height: auto;
    overflow-y: auto;
  }
}

.ant-col {
  > .ant-btn {
    margin-right: 10px;

    &:last-of-type {
      margin-right: 0;
    }
  }
}

.ant-table-wrapper {
  margin-top: 10px;
  background: #fff;
  padding: 5px;
  border-radius: 5px;

  .ant-pagination {
    padding-right: 5px;

    &.ant-table-pagination {
      margin-top: 5px;
      margin-bottom: 5px;
    }
  }
}

.btn-group {
  white-space: nowrap;
  flex-flow: row nowrap;

  > .ant-btn,
  > label {
    border-radius: 40px 0 0 40px !important;
    margin-right: -1px;

    &:not(:first-of-type) {
      border-radius: 0 !important;
      margin-right: -1px;

      &:hover {
        border-left-color: transparent;
      }
    }

    &:last-of-type {
      border-radius: 0 40px 40px 0 !important;

      &:hover {
        border-left-color: inherit;
      }
    }
  }
}

.ant-form {
  .ant-form-item {
    line-height: 1;
    margin-bottom: 6px;

    &:last-of-type {
      margin-bottom: 0;
    }
  }
}
